-
Notifications
You must be signed in to change notification settings - Fork 619
redirect /team/~/... to /team/<first-team-slug>/... #5158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redirect /team/~/... to /team/<first-team-slug>/... #5158
Conversation
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @MananTank and the rest of your teammates on |
80c6d2e to
d288f46
Compare
d288f46 to
98e26da
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5158 +/- ##
=======================================
Coverage 45.30% 45.30%
=======================================
Files 1067 1067
Lines 55304 55304
Branches 3970 3970
=======================================
Hits 25054 25054
Misses 29557 29557
Partials 693 693
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
| } | ||
| } | ||
|
|
||
| // redirect /team/~/... to /team/<first_team_slug>/... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't this just be /team? why do we need the extra /~ in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to have /team/ instead of /team/~/
- That breaks the usual format - it should be
/team/<team-slug>/<...otherSlugs> - We'll have to determine if otherSlugs[0] is not a valid team slug and then insert the first team's slug before them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you want to allow the deep-linking to something inside the default team - okay
| // TODO - need an API to get the first team to avoid fetching all teams | ||
| const teams = await getTeams(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we need a getDefaultTeam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a blocker however
| } | ||
| } | ||
|
|
||
| // redirect /team/~/... to /team/<first_team_slug>/... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you want to allow the deep-linking to something inside the default team - okay
Merge activity
|
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR adds functionality to redirect requests from `/team/~/...` to `/team/<first_team_slug>/...`, enhancing user navigation by ensuring that users are directed to the first team's slug instead of a placeholder.
### Detailed summary
- Added a check for the path starting with `team` and `~`.
- Implemented a call to `getTeams()` to retrieve the list of teams.
- If a team exists, modified the path to use the first team's slug.
- Redirects the request to the new path format.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
98e26da to
7185364
Compare

Problem solved
Short description of the bug fixed or feature added
PR-Codex overview
This PR introduces a new redirect functionality in the
middlewarefor handling requests to/team/~/..., redirecting them to the first team's slug.Detailed summary
teamand~.getTeams()to retrieve the list of teams.